#ifndef TRIE_H
#define TRIE_H

#include<vector>
#include<string>
#include<unordered_map>

class Trie{
private:
    struct TrieNode{
        std::unordered_map<char,TrieNode*> child;
        bool isEndOfWord;

        TrieNode();
    };

    TrieNode* root;

public:
    Trie();

    void insert(const std::string &word);
    void searchWithPrefix(TrieNode* node,const std::string &prefix,std::vector<std::string> &results);
    std::vector<std::string> getWordWithPrefix(const std::string &perfix);
};

#endif // TRIE_H
